package com.wzxl.api;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 马浩 mahao@aowlx.onaliyun.com
 * @Package com.wzxl.api
 * @Description: TODO ( 测试Controller )
 * @Date 2018/4/19 15:37
 * @Version V1.0
 */
@RestController
public class TestController {

    @RequestMapping(value = "/api/console/getid", method = RequestMethod.GET)
    public String show(HttpServletRequest request){
        Object o = request.getSession().getAttribute("springboot");
        if(o == null){
            o = "spring boot "+request.getLocalPort()+"生成";
            request.getSession().setAttribute("springboot", o);
        }

        return "端口=" + request.getLocalPort() +  " sessionId=" + request.getSession().getId() +"<br/>"+o;
    }
}
